/*****************************************************************************
 * Copyright (c) 2010 -, Anders All rights reserved
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 *  Contact: Anders Uddenberg (anders.uddenberg@gmail.com)
 * 
 *
 ****************************************************************************/
package org.easypr.organizer.client;

import java.util.ArrayList;

import org.easypr.organizer.shared.MyContact;
import org.easypr.organizer.shared.MyMeeting;
import org.easypr.organizer.shared.MyUser;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

// TODO: Auto-generated Javadoc
/**
 * The Interface BackboneService.
 */
@RemoteServiceRelativePath("backbone")
public interface BackboneService extends RemoteService {
	
	/**
	 * Save user.
	 *
	 * @param user the user
	 * @return the my user
	 */
	MyUser saveUser(MyUser user);
	
	/**
	 * Save contact.
	 *
	 * @param contact the contact
	 * @return the my contact
	 */
	MyContact saveContact(MyContact contact);
	
	/**
	 * Fetch contacts.
	 *
	 * @param user the user
	 * @param filter the filter
	 * @return the array list
	 */
	ArrayList<MyContact> fetchContacts(MyUser user, String filter);
	
	/**
	 * Search.
	 *
	 * @param searchString the search string
	 * @param user the user
	 * @return the array list
	 */
	ArrayList<MyContact> search(String searchString, MyUser user);
	
	/**
	 * Live search.
	 *
	 * @param searchString the search string
	 * @param user the user
	 * @return the array list
	 */
	ArrayList<MyContact> liveSearch(String searchString, MyUser user);
	
	/**
	 * Gets the by id.
	 *
	 * @param id the id
	 * @return the by id
	 */
	MyContact getById(long id);
	
	/**
	 * Save meeting.
	 *
	 * @param meeting the meeting
	 * @return the my meeting
	 */
	MyMeeting saveMeeting(MyMeeting meeting);
	
	/**
	 * Gets the meetings.
	 *
	 * @param user the user
	 * @param contactid the contactid
	 * @param beforeTime the before time
	 * @return the meetings
	 */
	ArrayList<MyMeeting> getMeetings(MyUser user, long contactid, int beforeTime);
	
	/**
	 * Gets the meetings navigation.
	 *
	 * @param userEmail the user email
	 * @param contactid the contactid
	 * @param beforeTime the before time
	 * @return the meetings navigation
	 */
	ArrayList<Integer> getMeetingsNavigation(String userEmail, long contactid, int beforeTime);
	
	/**
	 * Gets the o auth request url.
	 *
	 * @param user the user
	 * @param callbackURL the callback url
	 * @return the o auth request url
	 */
	String getOAuthRequestURL(MyUser user, String callbackURL);
	
	/**
	 * Fetch google contacts.
	 *
	 * @param user the user
	 * @param nextFeedURL the next feed url
	 * @return the array list
	 */
	ArrayList<MyContact> fetchGoogleContacts(MyUser user, String nextFeedURL);
	
	/**
	 * Gets the import next link.
	 *
	 * @return the import next link
	 */
	String getImportNextLink();
	
	/**
	 * Delete contact.
	 *
	 * @param contact the contact
	 * @return the boolean
	 */
	Boolean deleteContact(MyContact contact);
	
	/**
	 * Delete meeting.
	 *
	 * @param id the id
	 * @return the boolean
	 */
	Boolean deleteMeeting(long id);
}
